package com.xinqi.modules.course.course.dto.req;

import com.xinqi.common.green.annotation.Text;
import com.xinqi.modules.course.clazz.dto.req.ClassCreateNewDTO;
import com.xinqi.modules.course.course.enums.ClassAuditEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * 课程表-请求对象
 *
 * @author: system
 * @date: 2023/01/17
 */
@Data
@Schema(name = "课程表-新增-变更")
public class CourseCreateNewDTO implements Serializable {

    /**
     * 课程名称
     */
    @Text
    @NotBlank(message = "请输入课程名称")
    @Size(min = 0, max = 15, message = "{course.name.length.valid}")
    @Schema(description = "课程名称", example = "软件课")
    private String courseName;

    /**
     * 课程介绍
     */
    @Text
    @Size(min = 0, max = 300, message = "{course.introduce.length.valid}")
    @Schema(description = "课程介绍", example = "软件课JAVA")
    private String introduce;

    /**
     * 课程封面
     */
    @NotBlank(message = "请选择课程封面")
    @Schema(description = "课程封面", example = "")
    private String courseColorBg;

    /**
     * 选择学期（已弃用）
     */
    // @NotBlank(message = "请选择学期")
    @Schema(description = "选择学期", example = "2023-2024 第一学期")
    private String teachingNode;

    /**
     * 云课本id
     */
    @Schema(description = "云课本id", example = "123131313131313")
    private Long cloudTextbookId;

    /**
     * AUTO("AUTO", "自动免审核"),
     * MANUAL("MANUAL", "手动审核");
     */
    @NotNull(message = "请选择审核方式")
    @Schema(description = "审核方式", example = "AUTO")
    private ClassAuditEnum auditMethod;

    /**
     * 审核信息，例如：姓名，手机号等
     */
    @Text
    @Schema(description = "审核信息", example = "[姓名，手机号]")
    private List<String> auditInfo = Collections.emptyList();

    @NotEmpty(message = "缺少班级信息")
    @Valid
    @Schema(description = "班级信息", example = "")
    private List<ClassCreateNewDTO> classList;

}
